#include "Tank.h"


RotateFlipType rft[4] = { RotateNoneFlipNone, Rotate90FlipNone, Rotate180FlipNone, Rotate270FlipNone };

void Tank::Init(Image *i[])
{
	frame = 0;
	width = 32;
	height = 32;

	for (int j = 0; j < 4; ++j) {
		image[j][0] = i[0]->Clone();
		image[j][1] = i[1]->Clone();

		image[j][0]->RotateFlip(rft[j]);
		image[j][1]->RotateFlip(rft[j]);
	}

}

void Tank::Draw(Graphics* graphics, int x, int y, Direction dir) {
	graphics->DrawImage(image[dir][frame], x, y, width, height);
}

void Tank::Move() {
	frame = (frame + 1) % 2;
}
